package com.yc.http.v1.impl;

import com.yc.http.v1.*;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/Myinfo.s")
public class MyinfoServlet extends HttpServletImpl {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        response.setContentType("text/html;charser=UTF-8");
        PrintWriter out = response.getWriter();
        HttpSession session = request.getSession();
        Object name = session.getAttribute("myinfo");
        if (name == null){
            out.append("请先登录！").append("<a href='login,html>去登录'</a>");
        }else{
            out.append("欢迎：").append(name.toString());
        }

    }
}
